//
//  XYEmotionCellButton.swift
//  SinaWB_XY
//
//  Created by 小熊猫 on 15/10/27.
//  Copyright © 2015年 小熊猫. All rights reserved.
//

import UIKit

class XYEmotionCellButton: UIButton {

    var emotion:XYEmotionModel?{
        didSet{
            //如果是1 就是emoji表情,否则就是普通表情
            if emotion!.type == 1{
                self.setTitle((emotion!.code! as NSString).emoji(), forState: UIControlState.Normal)
                self.setImage(nil, forState: UIControlState.Normal)
            }else{
                self.setImage(UIImage(named: "\(emotion!.emojiPath!)/\(emotion!.png!)"), forState: UIControlState.Normal)
                self.setTitle(nil, forState: UIControlState.Normal)
            }
        }
    }
    
    //取消高亮状态
    override var highlighted :Bool{
        set{
            
        }
        get{
            return false
        }
    }
    
}
